/**
 * Created by gouyuheng on 2017/2/17.
 */
import $ from 'jquery'
import Vue from 'vue'
import {API_ROOT} from '../config.js'

Vue.prototype.http = function (url, data, success, error) {
  $.ajax({
    url: API_ROOT + url,
    type: 'post',
    data: JSON.stringify(data),
    success: success,
    dataType: 'json',
    contentType: 'application/json;charset=utf-8',
    error: error
  })
}
Vue.prototype.test = function () {
  console.log('1111')
}

const wx = require('weixin-js-sdk')
const plugin = {
  install (Vue) {
    Vue.prototype.$wechat = wx
    Vue.wechat = wx
  },
  $wechat: wx
}

export default plugin
export const install = plugin.install
